package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.OrderSaleMapper;
import com.sumi.erp.domain.OrderSale;
import com.sumi.erp.service.IOrderSaleService;

/**
 * 销售订单Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-21
 */
@Service
public class OrderSaleServiceImpl implements IOrderSaleService 
{
    @Autowired
    private OrderSaleMapper orderSaleMapper;

    /**
     * 查询销售订单
     * 
     * @param id 销售订单主键
     * @return 销售订单
     */
    @Override
    public OrderSale selectOrderSaleById(Long id)
    {
        return orderSaleMapper.selectOrderSaleById(id);
    }

    /**
     * 查询销售订单列表
     * 
     * @param orderSale 销售订单
     * @return 销售订单
     */
    @Override
    public List<OrderSale> selectOrderSaleList(OrderSale orderSale)
    {
        return orderSaleMapper.selectOrderSaleList(orderSale);
    }

    /**
     * 新增销售订单
     * 
     * @param orderSale 销售订单
     * @return 结果
     */
    @Override
    public int insertOrderSale(OrderSale orderSale)
    {
        orderSale.setCreateTime(DateUtils.getNowDate());
        return orderSaleMapper.insertOrderSale(orderSale);
    }

    /**
     * 修改销售订单
     * 
     * @param orderSale 销售订单
     * @return 结果
     */
    @Override
    public int updateOrderSale(OrderSale orderSale)
    {
        return orderSaleMapper.updateOrderSale(orderSale);
    }

    /**
     * 批量删除销售订单
     * 
     * @param ids 需要删除的销售订单主键
     * @return 结果
     */
    @Override
    public int deleteOrderSaleByIds(Long[] ids)
    {
        return orderSaleMapper.deleteOrderSaleByIds(ids);
    }

    /**
     * 删除销售订单信息
     * 
     * @param id 销售订单主键
     * @return 结果
     */
    @Override
    public int deleteOrderSaleById(Long id)
    {
        return orderSaleMapper.deleteOrderSaleById(id);
    }
}
